<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
</head>
<body>
<div id="app">
<!--    可以用in也可以用of-->
<!--    1.遍历数字-->
    <div v-for="(item,index) of num">item:{{item}}----index:{{index}}</div>
<!--    2.遍历数组-->
    <ul>
        <li v-for="item of arr">{{item.content}}</li>
    </ul>
<!--    3.遍历对象-->
    <ul>
        <li v-for="(value,key) in obj">value:{{value}}---key:{{key}}</li>
    </ul>
<!--    4.遍历字符串-->
    <ul>
        <li v-for="(value,key) of str">value:{{value}}---key:{{key}}</li>
    </ul>
</div>
<script>
    Vue.config.productionTip = false
    const vm = new Vue({
        el: '#app',
        data() {
            return {
              num:10,
                arr:[
                    {id:'001',content:'深圳'},
                    {id:'002',content:'上海'},
                    {id:'003',content:'北京'},
                    {id:'004',content:'杭州'},
                ],
                obj:{
                  name:'zhangsan',
                    age:18,
                    sex:'nan'
                },
                str:'hello,Vue'
            }
        }
    })
</script>
</body>
</html>